"""
    Author:
    Date: 2020-05-14
"""


from utils import ajax
from utils import haibao_util

from . helpers import uid_token_required

def _json(data):
    """ 将ApiServer返回的数据构造成给客户端展现的格式 """
    code, msg, info = data
    if code != 0:
        return ajax.error_response(msg, code)
    return ajax.success_response(info)


@uid_token_required
def get520_pair_activity_info(request):
    """ [520]获取520配对活动榜单的请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.get520PairActivityInfo', request.POST))


@uid_token_required
def take520_pair_activity_reward(request):
    """ [520]领取520配对活动奖励的请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.take520PairActivityReward', request.POST))


@uid_token_required
def get61_activity_info(request):
    """ [61]获取六一活动信息的请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.get61ActivityInfo', request.POST))


@uid_token_required
def take61_activity_reward(request):
    """ [61]领取六一活动奖励的请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.take61ActivityReward', request.POST))


@uid_token_required
def get_gift_box_output(request):
    """ [ACTIVITY]获取宝箱产出的请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getGiftBoxOutput', request.POST))


@uid_token_required
def get_dragon_boat_activity_info(request):
    """ [DRAGON_BOAT]获取端午节活动信息请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getDragonBoatActivityInfo', request.POST))


@uid_token_required
def get_dragon_boat_ranking(request):
    """ [DRAGON_BOAT]获取端午节活动排行榜请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getDragonBoatRanking', request.POST))


@uid_token_required
def take_dragon_boat_activity_reward(request):
    """ [DRAGON_BOAT]领取端午节活动奖励请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.takeDragonBoatActivityReward', request.POST))


@uid_token_required
def disable_master_skill(request):
    """ [MASTER]关闭接单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.disableMasterSkill', request.POST))


@uid_token_required
def enable_master_skill(request):
    """ [MASTER]开启接单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.enableMasterSkill', request.POST))


@uid_token_required
def update_master_settings(request):
    """ [MASTER]更新大神设置请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.updateMasterSettings', request.POST))


@uid_token_required
def apply_for_master(request):
    """ [MASTER]申请成为大神请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.applyForMaster', request.POST))


@uid_token_required
def edit_master_skill(request):
    """ [MASTER]编辑技能请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.editMasterSkill', request.POST))


@uid_token_required
def get_banner_list(request):
    """ [MASTER]获取Banner列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getBannerList', request.POST))


@uid_token_required
def get_master_info(request):
    """ [MASTER]获取大神信息请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getMasterInfo', request.POST))


@uid_token_required
def get_master_skill_info(request):
    """ [MASTER]获取大神技能信息请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getMasterSkillInfo', request.POST))


@uid_token_required
def get_master_skill_edit_info(request):
    """ [MASTER]获取大神技能编辑信息请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getMasterSkillEditInfo', request.POST))


@uid_token_required
def get_skill_meta_data(request):
    """ [MASTER]获取技能元数据请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getSkillMetaData', request.POST))


@uid_token_required
def get_skill_list(request):
    """ [MASTER]获取技能列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getSkillList', request.POST))


@uid_token_required
def get_skill_tag_list(request):
    """ [MASTER]获取技能标签列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getSkillTagList', request.POST))


@uid_token_required
def get_skill_rank_list(request):
    """ [MASTER]获取技能段位列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getSkillRankList', request.POST))


@uid_token_required
def get_user_public_info(request):
    """ [MASTER]获取用户基本信息请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getUserPublicInfo', request.POST))


@uid_token_required
def master_agree_refund_order(request):
    """ [ORDER]大神同意退款请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.masterAgreeRefundOrder', request.POST))


@uid_token_required
def master_start_order(request):
    """ [ORDER]大神开始服务请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.masterStartOrder', request.POST))


@uid_token_required
def master_refuse_order(request):
    """ [ORDER]大神拒绝接单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.masterRefuseOrder', request.POST))


@uid_token_required
def master_refuse_refund_order(request):
    """ [ORDER]大神拒绝退款请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.masterRefuseRefundOrder', request.POST))


@uid_token_required
def master_accept_order(request):
    """ [ORDER]大神接受订单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.masterAcceptOrder', request.POST))


@uid_token_required
def master_get_order_list(request):
    """ [ORDER]大神获取订单列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.masterGetOrderList', request.POST))


@uid_token_required
def user_place_order(request):
    """ [ORDER]用户下单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userPlaceOrder', request.POST))


@uid_token_required
def user_cancel_order(request):
    """ [ORDER]用户取消订单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userCancelOrder', request.POST))


@uid_token_required
def user_cancel_refund_order(request):
    """ [ORDER]用户取消订单退款请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userCancelRefundOrder', request.POST))


@uid_token_required
def user_pay_order(request):
    """ [ORDER]用户支付订单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userPayOrder', request.POST))


@uid_token_required
def user_finish_order(request):
    """ [ORDER]用户确认完成订单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userFinishOrder', request.POST))


@uid_token_required
def user_get_order_list(request):
    """ [ORDER]用户获取订单列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userGetOrderList', request.POST))


@uid_token_required
def user_appeal_order(request):
    """ [ORDER]用户订单申诉请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userAppealOrder', request.POST))


@uid_token_required
def user_apply_refund_order(request):
    """ [ORDER]用户订单退款请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userApplyRefundOrder', request.POST))


@uid_token_required
def user_comment_order(request):
    """ [ORDER]用户评论订单请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.userCommentOrder', request.POST))


@uid_token_required
def get_order_comment_list(request):
    """ [ORDER]获取订单评论列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getOrderCommentList', request.POST))


@uid_token_required
def get_order_comment_tag_list(request):
    """ [ORDER]获取订单评论标签列表请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getOrderCommentTagList', request.POST))


@uid_token_required
def get_order_comment_tag_stat_info(request):
    """ [ORDER]获取订单评论标签统计信息请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getOrderCommentTagStatInfo', request.POST))


@uid_token_required
def get_order_info(request):
    """ [ORDER]获取订单详情请求 """
    return _json(haibao_util.request_api_server('POST', 'TvProxy.getOrderInfo', request.POST))



if __name__ == '__main__':
    print('ok')